<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Online List Page</title>
</head>
<body>

	<form action="OnlineList.jsp" method="post">
		用户名: <input type="text" name="username" /> <br /> <input
			type="submit" />
	</form>

	<%@ page import="java.util.*"%>
	<%
		request.setCharacterEncoding("UTF-8");
		String username = request.getParameter("username");
		if (username == null)
			return;
		session.setAttribute("username", username);
		List onlineUserList = (List) application
				.getAttribute("onlineUserList");
		if (onlineUserList == null) {
			onlineUserList = new ArrayList();
			application.setAttribute("onlineUserList", onlineUserList);
		}
		onlineUserList.add(username);
	%>
	<table border="1">
		<%
			for (int i = 0; i < onlineUserList.size(); i++) {
				String tmp = (String) onlineUserList.get(i);
		%>
		<tr>
			<td><%=tmp%></td>
		</tr>
		<%
			}
		%>
	
</body>
</html>